Add non-reagent render namespace (avoid importing @testing-library/react) - #17
Merged
Conversation
…react Add react-testing-library-cljs.render wrapping render/cleanup/act from @testing-library/react, so plain-React (non-Reagent) tests no longer import the JS module directly. Migrate the library's own tests to it (the reagent variant already had reagent.render). The node-test-example keeps the direct import for now: it depends on the published 0.0.20, which predates this namespace. It can adopt the wrapper once a release including it ships.
Reference ../../src/main via :source-paths and drop the Clojars dependency, so the example builds against the in-repo library at HEAD with no publish step. This lets it adopt the new react-testing-library-cljs.render namespace immediately (plain-react test no longer imports @testing-library/react). reagent-karma-example intentionally stays on the published Clojars dependency to demonstrate that setup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plain-React (non-Reagent) tests previously imported
["@testing-library/react" :as rtl]directly just to getrender/cleanup— the library only wrapped those for Reagent (reagent.render/render!).react-testing-library-cljs.rendernamespace wrappingrender,cleanup, andact, so consumers don't reach into the JS module.@testing-library/reactimport to the new namespace (aliasedrtl, so call sites are unchanged).The
node-test-examplekeeps the direct import for now: it depends on the published0.0.20, which predates this namespace. It'll adopt the wrapper once a release including it ships (or if we point it at local source).Root validations green: fmt, lint, cljs-patrol (new namespace's docstrings pass), and all 49 tests.